<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <h2>{{msg}}</h2>
      <hr>
      <h2>{{msg.split("").reverse().join("")}}</h2>
      <hr>
      <h2>{{rev}}</h2>

      <hr>

      <h2>{{add}}</h2>

      <hr>

      <h2>{{num1 *1 + num2 *1 + num3*1 }}</h2>

      <input type="text" v-model.number='num1'>

      <h1>{{add}}</h1>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          msg: 'hello vue',
          num1: 10,
          num2: 20,
          num3: 30
      },
     computed: {
         rev() {
             return this.msg.split('').reverse().join('')
         },
         add() {
             console.log('1111');
             return this.num1 *1 + this.num2 *1 + this.num3*1 
         }
     }
     });
  </script>
</body>
</html>
